<?php
/*********************************************************************
 * CONFIG FILE
 * 
 * Author: hthieu1110
 * Date: 09/04/2011
 *********************************************************************/
# Include environnement config
require_once dirname(realpath(__FILE__)).'/env.php';

define("CONTROLLER_PATH", DOCUMENT_ROOT_PATH."/frontend/controller/");
define("VIEW_PATH", DOCUMENT_ROOT_PATH."/frontend/controller/modules/");
define("CSS_PATH", DOCUMENT_ROOT_PATH."/frontend/controller/css/");
define("MODEL_PATH", DOCUMENT_ROOT_PATH."/model/");
define("HELPER_PATH", DOCUMENT_ROOT_PATH."/helper/");
define("CACHE_PATH", DOCUMENT_ROOT_PATH."/frontend/cache/");
define("PHOTOS_PATH", DOCUMENT_ROOT_PATH."/frontend/controller/photos/");
define("ERROR_LOG_PATH", DOCUMENT_ROOT_PATH."/log/error.log");
define("TEMPLATE_PATH", DOCUMENT_ROOT_PATH."/frontend/controller/templates/");

define("ROOT_URL", 'http://'.DOMAIN_NAME.'/');
define("ADMIN_URL", "http://admin.raovat/");
define("CSS_URL", ROOT_URL."css/");
define("JS_URL", ROOT_URL."js/");
define("PHOTOS_URL", ROOT_URL.'photos/');
define("IMAGES_URL", ROOT_URL.'images/');

define("MAX_LOCALITY_SUGGESTION", 10);

define("MAX_SIZE_PHOTO_UPLOAD", 300000);

define("UPLOAD_PHOTO_PREVIEW_WIDTH", '80px');
define("UPLOAD_PHOTO_PREVIEW_HEIGHT", '60px');

define("THUMB_WIDTH", '80px');
define("THUMB_HEIGHT", '60px');

define("PHOTO_WIDTH", '480px');
define("PHOTO_HEIGHT", '320px');

define("MAX_ADS_PER_PAGE", 30);
define("MAX_PAGE_PER_SEGMENT", 10);

define("MAX_LENGTH_AD_TITLE", 120);
define("MAX_LENGTH_AD_DESCRIPTION", 4000);

#autoload function
if (!function_exists(__autoload)) {
    function __autoload($className){
	    require_once MODEL_PATH.$className.'.class.php';
    }
}

#allowed tags
#define("ALLOWED_TAGS", '<br><p><a><em><strong><cite><code><ul><ol><li><dl><dt><dd>');
	
#set default time zone
date_default_timezone_set('CET');

#include data definitions
require_once 'data.inc.php';

#include the head
require_once VIEW_PATH.'head.inc.php';